<?php //echo "<pre>"; print_r($selectedUser);die();?>
<?php $this -> load -> view('header'); ?>
<!-- BEGIN CONTAINER -->
<div class="page-container row-fluid">
	<?php //$this->load->view('sidebar');?>
	<!-- BEGIN PAGE -->
	<div class="page-content">
		<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
		<div id="portlet-config" class="modal hide">
			<div class="modal-header">
				<button data-dismiss="modal" class="close" type="button"></button>
				<h3>portlet Settings</h3>
			</div>
			<div class="modal-body">
				<p>
					Here will be a configuration form
				</p>
			</div>
		</div>
		<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
		<!-- BEGIN PAGE CONTAINER-->
		<div class="container-fluid">
			<!-- BEGIN PAGE HEADER-->
			<div class="row-fluid">
				<div class="span12">
					<!-- BEGIN STYLE CUSTOMIZER -->
					<!--
					<div class="color-panel hidden-phone">
						<div class="color-mode-icons icon-color"></div>
						<div class="color-mode-icons icon-color-close"></div>
						<div class="color-mode">
							<p>
								THEME COLOR
							</p>
							<ul class="inline">
								<li class="color-black current color-default" data-style="default"></li>
								<li class="color-blue" data-style="blue"></li>
								<li class="color-brown" data-style="brown"></li>
								<li class="color-purple" data-style="purple"></li>
								<li class="color-white color-light" data-style="light"></li>
							</ul>
							<label class="hidden-phone">
								<input type="checkbox" class="header" checked value="" />
								<span class="color-mode-label">Fixed Header</span> </label>
						</div>
					</div> -->
					<!-- END BEGIN STYLE CUSTOMIZER -->

					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<?php $this -> load -> view('breadcrumb'); ?>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<div class="row-fluid">
				<div class="span12">
					<!-- BEGIN EXAMPLE TABLE PORTLET-->
					<div class="portlet box blue">
						<div class="portlet-title">
							<h4><i class="icon-edit">Tambah Pengguna</i></h4>
							<!--<div class="tools" >
								<a href="javascript:;" class="reload"></a>
							</div>-->
						</div>
						<div class="portlet-body">
							<form id="userForm" action="<?php echo base_url()?>administration/changePassword" method="post" class="form-horizontal">
					           <div class="control-group">
					              <label class="control-label">Nama Pengguna</label>
					              <div class="controls">
					                  <input type="text" class="span3" name="User.userId" id="pUserId" value="<?php echo $user->getUserId();?>" readonly/>                  
					              </div>
					           </div>
					           <div class="control-group">
					              <label class="control-label">Password Baru</label>
					              <div class="controls">
					                  <input type="password" class="span3" name="User.password" id="pPassword"/>                  
					              </div>
					           </div>
							   <div class="control-group">
					              <label class="control-label">Konfirmasi Password</label>
					              <div class="controls">
					                  <input type="password" class="span3" name="User.confirmPassword" id="pPassword"/>                  
					              </div>
					           </div>
							   <div class="control-group">
					              <label class="control-label">Password Lama</label>
					              <div class="controls">
					                  <input type="password" class="span3" name="User.oldPassword" id="pPassword"/>                  
					              </div>
					           </div>
					           <div class="form-actions">
									<button type="submit" class="btn blue" id="saveBtn">
										<i class="icon-ok"></i> Simpan
									</button>
									<button type="button" class="btn" id="cancelBtn">
											Batal
									</button>
								</div>
					       </form>
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
				</div>
			</div>
		</div>
		<!-- END PAGE CONTAINER-->
	</div>
	<!-- END PAGE -->
</div>
<!-- END CONTAINER -->

<!-- DIALOG -->
<!--
<div id="addUserModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
		<h3 id="myModalLabel1">Tambah Pengguna</h3>		
	</div>
<div class="modal-body">
	<div class="portlet-body fuelux">
		<form action="#" class="form-horizontal">
           <div class="control-group">
              <label class="control-label">Nama Pengguna</label>
              <div class="controls">
                  <input type="text" class="span3" />                  
              </div>
           </div>
           <div class="control-group">
                <label class="control-label">Jabatan</label>
                              <div class="controls">
                                 <select class="span3 chosen" data-placeholder="--Pilih Jabatan--" tabindex="1">
                                    <option value=""></option>
                                    <option value="Category 1">CBO</option>
                                    <option value="Category 2">CF</option>
                                    <option value="Category 3">DQA</option>
                                    <option value="Category 4">Koordinator IT</option>
                 				</select>
              </div>
           </div>
           <div class="control-group">
                <label class="control-label">Jabatan</label>
                <div class="controls">
                   <select data-placeholder="Jabatan" class="chosen span3" tabindex="-1" id="selS0V">
                      <option value=""></option>
                      <optgroup label="Profil Inbox">
                      	<option>Dallas Cowboys</option>
                      	<option>New York Giants</option>
                      	<option>Philadelphia Eagles</option>
                      	<option>Washington Redskins</option>
                      </optgroup>
                      <optgroup label="Profil Administrasi Berkas">
                      	<option>Chicago Bears</option>
                        <option>Detroit Lions</option>
                        <option>Green Bay Packers</option>
                        <option>Minnesota Vikings</option>
                      </optgroup>
					</select>
                </div>
           </div>
       </form>                 
	</div>	
</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
		<button class="btn yellow" id="saveNote">Save</button>
	</div>
</div>-->
<!-- END DIALOG -->
<!--
<div id="cancelModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel3" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
		<h3 id="myModalLabel3">Confirm Header</h3>
	</div>
	<div class="modal-body">
		<p>Apakah anda yakin membatalkan laporan ini ?</p>				
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">Tidak</button>
		<button data-dismiss="modal" class="btn blue" id="confirmCancelBtn">Ya</button>
	</div>
</div>
-->	
<div id="alertModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
		<h3 id="myModalLabel2">Informasi</h3>
	</div>
	<div class="modal-body" id="alertMessage">
		
	</div>
	<div class="modal-footer">
		<button data-dismiss="modal" class="btn green">OK</button>
	</div>
</div>

<?php $this->load->view('footer')?>

<script>
	$(document).ready(function() {
		 $("#alertModal").draggable({
      		handle: ".modal-header"
  		});
		
		//$('#alertModal').modal('show');
		<?php
			$flash_message = $this->session->userdata('flash_message');
			if ($flash_message != ""){
				echo "$('#alertMessage').html('<p>".$flash_message."</p>');
					  $('#alertModal').modal('show');
					 ";
				$this->session->set_userdata('flash_message',"");
			} 
		?>
		$("#addUserModal").draggable({
		      handle: ".modal-header"
		}); 
		 
		$("#addUserModal" ).dialog({
		      height: 300,
		      width: 400,
		      modal: true
		 }); 
		$('#cancelBtn').click(function (event){			
			event.preventDefault();
			$('#pUserId').val("");
			$('#pPassword').val("");
			$('#pJabatan').val("-1");
			$('#pJabatan').trigger("liszt:updated");
			//$("#pProfil").multiselect("clearSelection");
			//$("#pProfil").multiselect( 'refresh' );
			//$("#pProfil > option").attr("selected",false);
			$("#pProfil option:selected").removeAttr("selected");
			$('#pProfil').trigger("liszt:updated");			
		});
		
	/*	$('#pUserId').keypress(function (e) {
		    var regex = new RegExp("^[a-zA-Z0-9]+$");
		    var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
		    if (regex.test(str)) {
		        return true;
		    }
		    e.preventDefault();
		    return false;
	}); */
		
		$('#saveBtn').click(function(event){
			/*  validasi */
			event.preventDefault();
			/*if ($('#distrik').val() == "-1"){
				alert('District cannot be null...');
				return;
			}*/
			if ($('#pUserId').val() == ""){
				alert('Silahkan memasukkan nama pengguna');
				return;
			}
			
			if ($('#pUserId').val() == ""){
				alert('Silahkan memasukkan nama pengguna');
				return;
			}
			
			
	  		$('#userForm').submit();
	  	});
	});
</script>